﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Linq;
using System.Data.Linq.Mapping;

namespace NIIT.Domain
{
    public class CourceInfoConstant
    {
        public const string TABLE_NAME = "COURSE_INFO";
        public const string COURSE_ID = "CourseID";
        public const string COURSE_NAME = "CourseName";
        public const string CENTER_NAME = "CenterName";
        public const string DAY_SCHOOL = "DaySchool";
        public const string OPEN_DAY = "OpenDay";
    }
    [Table(Name=CourceInfoConstant.TABLE_NAME)]
    public class CourseInfo:BaseDomain<CourseInfo>,ICommonFunction<CourseInfo>
    {
        #region private place
        private int _CourseID;

        private string _CourseName;

        private string _CenterName;

        private string _DaySchool;

        private string _OpenDay;
        private System.Data.Linq.Binary _TIME_STAMP;
        #endregion
        [Column(Name=CourceInfoConstant.COURSE_ID , Storage = "_CourseID", AutoSync = AutoSync.OnInsert, DbType = "Int NOT NULL IDENTITY", IsPrimaryKey = true, IsDbGenerated = true)]
        public int CourseID
        {
            get
            {
                return this._CourseID;
            }
            set
            {
                if ((this._CourseID != value))
                {
                    this._CourseID = value;
                   
                }
            }
        }

        [Column(Name = CourceInfoConstant.COURSE_NAME, Storage = "_CourseName", DbType = "NVarChar(200)")]
        public string CourseName
        {
            get
            {
                return this._CourseName;
            }
            set
            {
                if ((this._CourseName != value))
                {
                    this._CourseName = value;
                   
                }
            }
        }

        [Column(Name = CourceInfoConstant.CENTER_NAME, Storage = "_CenterName", DbType = "NVarChar(500)")]
        public string CenterName
        {
            get
            {
                return this._CenterName;
            }
            set
            {
                if ((this._CenterName != value))
                {
                    this._CenterName = value;
                }
            }
        }

        [Column(Name = CourceInfoConstant.DAY_SCHOOL, Storage = "_DaySchool", DbType = "NVarChar(500)")]
        public string DaySchool
        {
            get
            {
                return this._DaySchool;
            }
            set
            {
                if ((this._DaySchool != value))
                {
                    this._DaySchool = value;
                }
            }
        }

        [Column(Name = CourceInfoConstant.OPEN_DAY, Storage = "_OpenDay", DbType = "NVarChar(200)")]
        public string OpenDay
        {
            get
            {
                return this._OpenDay;
            }
            set
            {
                if ((this._OpenDay != value))
                {
                    this._OpenDay = value;
                }
            }
        }
        [Column(Storage = "_TIME_STAMP", AutoSync = AutoSync.Always, DbType = "rowversion NOT NULL", CanBeNull = false, IsDbGenerated = true, IsVersion = true, UpdateCheck = UpdateCheck.Never)]
        public System.Data.Linq.Binary TIME_STAMP
        {
            get
            {
                return this._TIME_STAMP;
            }
            set
            {
                if ((this._TIME_STAMP != value))
                {

                    this._TIME_STAMP = value;

                }
            }
        }
        public CourseInfo GetByPrimaryKey()
        {
            CourseInfo result = GetTable().SingleOrDefault(p => p.CourseID.Equals(this.CourseID));
            return result;
        }
    }
}
